export default {
    state: {
        city: {},
        citypois: []
    },
    mutations: {
        cityObj (state, val) {
            state.city = val
        },
        historyList (state, val) {
            let bool = true
            if (state.citypois.length) {
                state.citypois.forEach(i => {
                    if (i.name == val.name) {
                        bool = false
                    }
                });
                bool && state.citypois.push(val)
            } else {
                state.citypois.push(val)
            }
            console.log(val);
        },
        del (state) {
            state.city = []
        },

    }
}